import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@v/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    component: Home,

  },
  {
    path: '/contactUs',
    name: 'contactUs',
    component: () => import('@v/ContactUs.vue'),

  },
  {
    path: '/document',
    name: 'document',
    component: () => import('@v/Document.vue'),

  },
  {
    path: '/demand',
    name: 'demand',
    component: () => import('@v/Demand.vue'),
  },
  {
    path: '/registered',
    name: 'registered',
    component: () => import('@v/Registered.vue'),
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@v/Login.vue'),
  },
  {
    path: '/botDetail',
    name: 'botDetail',
    component: () => import('@v/BotDetail.vue'),
  },
  {
    path: '/newsList',
    name: 'newsList',
    component: () => import('@v/newsList.vue'),
  },
  {
    path: '/newsDetail',
    name: 'newsDetail',
    component: () => import('@v/newsDetail.vue'),
  },
  {
    path: '/hotBot',
    name: 'hotBot',
    component: () => import('@v/hotBot.vue'),
  },
]

const router = new VueRouter({
  routes,
  scrollBehavior(to, from, savedPosition) {
    return { x: 0, y: 0 };
  },
})

export default router
